package oa.hleast.xswl.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@AllArgsConstructor
@NoArgsConstructor
public enum BannerShowStatusEnum {
    ALL(0, "全部"),
    SHOWING(1, "展示中"),
    INVALID(10, "未生效"),
    EXPIRED(11, "已过期");

    @Getter
    @Setter
    private Integer code;

    @Getter
    @Setter
    private String name;


    public static BannerShowStatusEnum getValue(Integer code) {
        for (BannerShowStatusEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
